import { createRouter, createWebHashHistory } from "vue-router"
import Layout from '@/layout/main.vue'

const routes=[
    {
        path: "/",
        component: Layout,
        children: [
            {
                path: '/',
                name: "Home",
                component: () => import("../view/home/index.vue")
            },
            {
                path: "/:catchAll(.*)",
                redirect: "/"
            },    
            {
                path: '/partyBuilding',
                name: "PartyBuilding",
                component: () => import("../view/partyBuilding/index.vue")
            },
            {
                path: '/govern',
                name: "Govern",
                component: () => import("../view/govern/index.vue")
            },    
            {
                path: '/travel',
                name: "Travel",
                component: () => import("../view/travel/index.vue")
            },
        ]
    },
    {
        path: '/familyInfo',
        name: "FamilyInfo",
        component: () => import("../view/familyInfo/index.vue")
    }
]

//添加到创建的路由中
const router=createRouter({
    history:createWebHashHistory(),
    routes
})

export default router
